home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Shareware / Comunicatii / feedaemon / fd110rc5.exe / {app} / Data / defaults / styles / Headlines.fdxsl < prev    next >
Extensible Markup Language  |  2004-02-16  |  5KB  |  138 lines

  1. <?xml version="1.0"?>
  2.  
  3. <xsl:stylesheet version="1.0"
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/">
  6. <xsl:output method="html"/>
  7.  
  8. <xsl:variable name="common-styles">
  9.     <style type="text/css">
  10.         body { background-color: white; color: black; font: 80% Tahoma, Verdana, Arial, sans-serif; margin: 2px 28px; }
  11.         a { color: #0002CA; text-decoration: none }
  12.         a:hover { color: #6B8ADE; text-decoration: underline; }
  13.         span.nodescription {    color: silver;    font-size: smaller; }
  14.  
  15.         /* override headings used by feeds */
  16.         h1,h2,h3,h4,h5,h6 { font-size: 80%; font-weight: bold; font-style: italic;    }
  17.  
  18.         div.newspapertitle { font-weight: bold; font-size: 120%; text-align: center; text-transform: uppercase; margin: 24px 0}
  19.         
  20.         div.channeltitle { font-weight: bold; text-transform: uppercase; margin-top: 12px; }
  21.         div.channeltitle a { text-decoration: underline; }
  22.  
  23.         div.newsitemcontent ol, div.newsitemcontent ul { list-style-position: inside;}        
  24.         div.newsitemtitle { margin-bottom: 3px }
  25.         div.newsitemfooter { color: gray; font-size: xx-small; text-align: right; font-style: italic; margin-top: 6px; margin-bottom: 18px; }
  26.         div.newsitemcontent { line-height: 150%; }
  27.     </style>
  28. </xsl:variable>
  29.  
  30. <!-- channel group newspaper -->
  31. <xsl:template match="newspaper[@type='group']">
  32.     <html xmlns:m="http://www.w3.org/1998/Math/MathML">
  33.     <head>
  34.         <title>Group Newspaper</title>
  35.         <xsl:copy-of select="$common-styles"/>
  36.     </head>
  37.     <body>
  38.         <div class="newspapertitle"><xsl:value-of select="title" disable-output-escaping="yes"/></div>
  39.         
  40.         <!-- loop through each channel -->
  41.         <xsl:for-each select="channel">
  42.             <xsl:variable name="chanlink" select="link"/>
  43.             <xsl:variable name="chantitle" select="title"/>
  44.         
  45.             <!-- channel -->
  46.             <div class="channeltitle">
  47.                 <a href="{$chanlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
  48.             </div>
  49.             
  50.             <!-- loop through each news item -->
  51.             <ol>
  52.             <xsl:for-each select="item">
  53.                 <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
  54.                <div class="newsitemtitle">
  55.                     <xsl:variable name="itemlink" select="link"/>
  56.                    <li><a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a></li>
  57.                 </div>
  58.               </xsl:for-each>
  59.             </ol>
  60.         </xsl:for-each>
  61.     </body>
  62.     </html>    
  63. </xsl:template>
  64.  
  65. <!-- channel newspaper -->
  66. <xsl:template match="newspaper[@type='channel']">
  67.     <html xmlns:m="http://www.w3.org/1998/Math/MathML">
  68.     <head>
  69.         <title>Channel Newspaper</title>
  70.         <xsl:copy-of select="$common-styles"/>
  71.     </head>
  72.     <body>
  73.         <div class="newspapertitle"><xsl:value-of select="title" disable-output-escaping="yes"/></div>
  74.         
  75.         <!-- loop through each news item -->
  76.         <ol>
  77.         <xsl:for-each select="channel/item">
  78.             <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
  79.            <div class="newsitemtitle">
  80.               <xsl:variable name="itemlink" select="link"/>
  81.                <li><a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a></li>
  82.             </div>
  83.           </xsl:for-each>
  84.         </ol>
  85.     </body>
  86.     </html>
  87. </xsl:template>
  88.  
  89. <!-- single news item -->
  90. <xsl:template match="newspaper[@type='newsitem']">
  91.     <html xmlns:m="http://www.w3.org/1998/Math/MathML">
  92.     <head>
  93.         <title>News Item</title>
  94.         <xsl:copy-of select="$common-styles"/>
  95.         <style>
  96.             div.newspapertitle { text-transform: none; text-align: left; margin: 14px 0; font-size: 100%}
  97.             div.newspapertitle a { text-decoration: underline;    }
  98.         </style>
  99.     </head>
  100.     <body>
  101.         <xsl:for-each select="channel/item">        
  102.            <div class="newspapertitle">
  103.               <xsl:variable name="itemlink" select="link"/>
  104.                <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
  105.             </div>
  106.             <div class="newsitemcontent">
  107.                 <xsl:value-of select="description" disable-output-escaping="yes"/>
  108.             </div>
  109.             <div class="newsitemfooter">
  110.                 <!-- 
  111.                 Important: use 'source' element here so that source channel shows for 
  112.                 newsbins and watches.  For other channels, FeedDemon sets the source
  113.                 to the channel itself.
  114.                 -->
  115.                 <xsl:variable name="srclink" select="source/@htmlUrl"/>
  116.                 <a href="{$srclink}"><xsl:value-of select="source"/></a>
  117.                 <!-- add link to comments if available -->
  118.                 <xsl:if test="comments">
  119.                     <xsl:variable name="commentlink" select="comments"/>
  120.                     <xsl:variable name="commentimg" select="'$IMAGEDIR$comments.gif'"/>
  121.                     <a href="{$commentlink}"><img src="{$commentimg}" border="0" hspace="6"/></a>
  122.                 </xsl:if>
  123.                 <!-- add link to enclosure if available -->
  124.                 <xsl:if test="enclosure">
  125.                     <xsl:variable name="enclosurelink" select="enclosure/@url"/>
  126.                     <xsl:variable name="enclosureimg" select="'$IMAGEDIR$enclosure.gif'"/>
  127.                     <a href="{$enclosurelink}"><img src="{$enclosureimg}" border="0" hspace="6"/></a>
  128.                 </xsl:if>
  129.                 <br />
  130.                 <xsl:value-of select="fd:dateDisplay"/>
  131.             </div>
  132.           </xsl:for-each>
  133.         
  134.     </body>
  135.     </html>
  136. </xsl:template>
  137.  
  138. </xsl:stylesheet>